Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: from frugalos_dyn to master #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

PR: from frugalos_dyn to master #1

wants to merge 6 commits into from

Conversation

yuezato
Copy link
Member

@yuezato yuezato commented Dec 4, 2018

frugalos_dynブランチは以下の内容を含む:

  1. threadsafeブランチで行われたjerasureのマルチスレッド対応
  2. 生成されるライブラリ名を、libJerasure から libFrugalosJerasure に変更する

(libFrugalosJerasureへの変更などは、openstack/liberasurecodeの変更などを生む)

src/galois.c Outdated
if (!gfp) {
gf2p = (gf2_t *) malloc(sizeof(gf2_t));
gf2p->gf = (gf_t *) malloc(sizeof(gf_t));
if (!gf2p || gf2p->gf) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line be like if (!gf2p || !gf2p->gf)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se-ya-na

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to fix this.

{
int *matrix, i;

if (m == 2 && k <= cbest_max_k[w]) {
matrix = talloc(int, k*m);
if (matrix == NULL) return NULL;
if (!cbest_init) {
if (!cbest_init) { /* not safe for multithreads. need CAS */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これは未修正?

extern int galois_uninit_field(int w);
extern void galois_change_technique(gf_t *gf, int w);
typedef struct gf2_t_ {
gf_t* gf;
Copy link
Member

@koba-e964 koba-e964 Jul 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get why this member is necessary.
I think it's okay to remove this member and make galois_init_field return both gf2_t and gf_t created.
I'm commenting because it seems that gf2_t is the global state packed in a struct, and gf_t* gf created in galois_init_field doesn't look like a global state and is not used elsewhere in this repository.
(except initialization and galois_destroy, of course!)

gf_t* gf;
gf_t* gfp_array[64];
int gfp_is_composite[64];
} gf2_t;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't recommend naming this struct as gf2_t because it is easily confused with GF(2), the finite field with two elements. (gf_state_t should be better I think?)

@koba-e964
Copy link
Member

Should refer to frugalos/liberasurecode#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants